package observer;

import java.lang.reflect.Method;

public class Event {
    private Object source;
    private Object target;
    private Method callback;
    private String trigger;
    private long time;

    public Event(Object target,Method callback){
        this.target = target;
        this.callback = callback;
    }

    public Object getSource() {
        return source;
    }

    public void setSource(Object source) {
        this.source = source;
    }

    public Object getTarget() {
        return target;
    }

    public void setTarget(Object target) {
        this.target = target;
    }

    public Method getCallback() {
        return callback;
    }

    public void setCallback(Method callback) {
        this.callback = callback;
    }

    public String getTrigger() {
        return trigger;
    }

    public void setTrigger(String trigger) {
        this.trigger = trigger;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    @Override
    public String toString() {
        return "Event{\n" +
                "\tsource=" + source.getClass() +",\n" +
                "\ttarget=" + target.getClass() + ",\n" +
                "\tcallback=" + callback.getClass() + ",\n" +
                "\ttrigger=" + trigger + ",\n" +
                "\ttime=" + time + "\n}";
    }
}
